package bean;

import java.util.ArrayList;
import java.util.List;

public class Project {

  private int id;
  private String name;
  private List<Task> tasks;

  public Project()
  {
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public List<Task> getTasks() {
    return tasks;
  }

  public void setTasks(List<Task> tasks) {
    this.tasks = tasks;
  }

  public void addTask(Task task)
  {
    task.setProject(this);
    if (tasks == null)
    {
      tasks = new ArrayList<Task>();
    }
    tasks.add(task);
  }
}
